Search and Replace Regular Expression Examples

image\regex2_shg.gif

image\relicon1.gifAlso see

Regular Expression Search & Replacement Examples

Search String

Replace String

Effect

*.*

%1>.%2>

c:\windows\win.ini => C:\WINDOWS\WIN.INI

+[a-z]

%1>

Windows => WINDOWS

7*.htm

5%1.htm

711.htm => 511.htm
7days.htm => 5days.htm

[253]7[832].htm

%15%2.htm

3572.htm => 3552.htm

*[253]7[832].htm

%15%2.htm

72.htm => 52.htm

(homepage|index).htm

%11.htm

homepage.htm => homepage1.htm
index.htm => index1.htm

+(12)*[0-9]

%1%2a

12532 => 12532a
1212753 => 1212753a

*(d|m).htm

%1%2%3d1.htm

card.htm => card1.htm
form.htm => ford1.htm

*[\r]\n!(\r\n)

\r\n

Converts UNIX to DOS end-of-line termination.

?(Windows)

OS/2

Windows => OS/2 (just kidding)

 

back2.jpg*[]height="30"

back2.jpg%1height="32"

src="images/back2.jpg" alt="Go Back"  border="0" width="57" height="30"

 

becomes:

 

src="images/back2.jpg" alt="Go Back"  border="0" width="57" height="32"

 

Note: This search - replace changes the height setting for 'back2.jpg' regardless of differing 'alt' text or how the html editor line breaks the code across lines.